%% Table: Counterfactual changes by quintile of quality

    % for appendix only
    print_table_cf_by_quintile(ge_cf1, '../../output/tables/Table8_B.tex')      
        
   
    
%% Table: Summary of Counterfactual Specifications

%    filename = '../../output/tables/fullmodel_cf_policy_summary.tex';    
    filename = '../../output/tables/Table10.tex';    
    delete(filename)
    diary(filename)
    diary on   

    fprintf('\\begin{tabular}{lcccc}'); fprintf('\n');
    fprintf('\\hline\\hline\\\\[-0.8em]'); fprintf('\n');
    fprintf(' & Baseline & Balanced Trade & $\\Delta$ Skill Premium & Agglomeration \\\\[0.2em]'); fprintf('\n');
    fprintf('  & (1) & (2) & (3) & (4) \\\\[0.2em]'); fprintf('\n');
    fprintf('\\hline\\\\[-0.8em]'); fprintf('\n');
    fprintf('Percentage changes \\\\[0.5em]');   
    fprintf('\\quad Average wage per worker (All) & %.2f & %.2f & %.2f & %.2f \\\\[0.5em]', ...
        ge_cf1.overall_wage_all, ge_cf2.overall_wage_all, ge_cf3.overall_wage_all, ge_cf4.overall_wage_all); fprintf('\n');
    fprintf('\\quad Average wage per worker (Exporters) & %.2f & %.2f & %.2f & %.2f \\\\[0.5em]', ...
        ge_cf1.overall_wage_exp_ctn, ge_cf2.overall_wage_exp_ctn, ge_cf3.overall_wage_exp_ctn, ge_cf4.overall_wage_exp_ctn); fprintf('\n');
    fprintf('\\quad Average quality (All) & %.2f & %.2f & %.2f & %.2f \\\\[0.5em]', ...
        ge_cf1.overall_qlevel_all, ge_cf2.overall_qlevel_all, ge_cf3.overall_qlevel_all, ge_cf4.overall_qlevel_all); fprintf('\n');
    fprintf('\\quad Manufacturing output ($X$)                  & %.2f & %.2f & %.2f & %.2f \\\\[0.5em]', (eqm_cf1.X-1)*100, (eqm_cf2.X-1)*100, (eqm_cf3.X-1)*100, (eqm_cf4.X-1)*100 ); fprintf('\n');
    fprintf('\\quad Real exchange rate ($e$)            & - & %.2f & - & - \\\\[0.5em]', (eqm_cf2.e-1)*100); fprintf('\n');
    fprintf('\\quad Efficiency wage at $w(q^{max})$ & - & - & %.2f & - \\\\[0.5em]', (param.w_cf3(param.Q)-1)*100); fprintf('\n');   
        
    fprintf('\\hline\\\\[-0.8em]'); fprintf('\n');
    fprintf('Counterfactual levels (in percent)\\\\[0.3em]');     
    fprintf('\\quad Export/output$^*$     & %.1f & %.1f & %.1f & %.1f \\\\[0.3em]', eqm_cf1.B1/eqm_cf1.X*100, eqm_cf2.B1/eqm_cf2.X*100, eqm_cf3.B1/eqm_cf3.X*100, eqm_cf4.B1/eqm_cf4.X*100 ); fprintf('\n');
    fprintf('\\quad Lump-sum transfer/household income   & %.2f & %.2f & %.2f & %.2f \\\\[0.3em]', -eqm_cf1.T/eqm_cf1.household_income*100, -eqm_cf2.T/eqm_cf2.household_income*100, -eqm_cf3.T/eqm_cf3.household_income*100, -eqm_cf4.T/eqm_cf4.household_income*100); fprintf('\n');

    fprintf('\\hline\\hline'); fprintf('\n');
    fprintf('\\end{tabular}'); fprintf('\n');
    
    diary off    
    
    
    